//
//  NewAddrCell.m
//  MIDI
//
//  Created by E.M.Game on 15/9/15.
//  Copyright (c) 2015年 QXSX. All rights reserved.
//

#import "NewAddrCell.h"
#import "CommFunc.h"

@implementation NewAddrCell

- (void)awakeFromNib {
    // Initialization code
    
    self.addr.hidden = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    //[super setSelected:selected animated:animated];
}

+ (id)loadFromNib
{
    NSString *nibName = NSStringFromClass([self class]);
    return [[[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil] firstObject];
}

-(int)getHeight
{
    int height = [CommFunc sizeWithString:self.addr.text
                                     font:[UIFont fontWithName:@"Hiragino Sans GB" size:15]
                                      max:CGSizeMake(self.addr.frame.size.width, MAXFLOAT)].height;
    
    if (height <= 0)
        return 216;
    else
    {
        height = self.addr.frame.origin.y + height + 50;
        return height;
    }
    
    return 0;
}

@end



















